package com.mchsdk.paysdk.http;

import com.lidroid.xutils.http.ResponseInfo;
import com.mchsdk.paysdk.utils.Base64;
import com.mchsdk.paysdk.utils.MCLog;

/**解密返回参数，打印返回参数*/
public class RequestUtil {

	private static final String TAG_HTTP = "RequestUtil";

	public static String getResponse(final ResponseInfo<String> responseInfo) {
		String response = "";
		MCLog.i(TAG_HTTP, "responseInfo.result:" + responseInfo.result);
//				responseInfo.result.trim().replaceAll(" ", "");
		try {
			response = new String(Base64.decode(responseInfo.result.trim()), "utf-8");
		} catch (Exception e) {
			MCLog.e(TAG_HTTP, "decode:" + e);
			response = "";
		}
		MCLog.w(TAG_HTTP, "response:" + response);
		return response;
	}
}
